home *** CD-ROM | disk | FTP | other *** search
Wrap
<?xml version="1.0"?> <!-- /*////////////////////////////////////////////////////////////////////// Filename: wsn-rules.xsl Company Name: Computer Associates International, Inc. Legal Copyright: Copyright (c) Computer Associates International, Inc. Author: Ales Novak Product: Tiny Firewall Description: Windows Security: lists all rules by object type Last Modification: September 7, 2004 Revision History: Created July 2004 ///////////////////////////////////////////////////////////////////////*/ --> <!--////////////////////////////////////////////////////////////////////////////////// // Parameters (passed as <root-node>/Params/Param node with @name and data as a value): // ot => object type string, e.g. Registry // at_XXX=<value of AT_YYY> => e.g. for AT_KEY_READ => at_KeyRead=25 // priority => high, low or normal (default) // readonly => true/false // usercolumn => show, showempty, hide // otid => used for OnEditRule only, e.g. OT_REGISTRY // editobjhdr => used for OnEditRule only, e.g. "Registry Key" // editatcolumns => used for OnEditRule only, e.g. "Read|Create|Write|Delete" ///////////////////////////////////////////////////////////////////////////////////--> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tiny="http://tinysoftware.com/tinynamespace"> <xsl:output method="html"/> <xsl:variable name="INCLUDED_FILES">../common/tools.xsl</xsl:variable> <!--Parameters to be passed to the XSLT transformation--> <xsl:variable name="ot" select="//Params/Param[@name='ot']"/> <xsl:variable name="otid" select="//Params/Param[@name='otid']"/> <xsl:variable name="priority" select="//Params/Param[@name='priority']"/> <xsl:variable name="readonly" select="//Params/Param[@name='readonly']"/> <xsl:variable name="usercolumn" select="//Params/Param[@name='usercolumn']"/> <xsl:variable name="accountcolumn" select="//Params/Param[@name='accountcolumn']"/> <xsl:variable name="editobjhdr" select="//Params/Param[@name='editobjhdr']"/> <xsl:variable name="editatcolumns" select="//Params/Param[@name='editatcolumns']"/> <xsl:variable name="disableChb" select="//Params/Param[@name='disableChb']"/> <xsl:variable name="clientrule" select="//Params/Param[@name='clientrule']"/> <xsl:variable name="viewmode" select="//Params/Param[@name='viewmode']"/> <xsl:variable name="easymode" select="//Params/Param[@name='easymode']"/> <xsl:variable name="sortParam" select="//Params/Param[@name='sortParam']"/> <xsl:variable name="proversion" select="//Params/Param[@name='proversion']"/> <xsl:variable name="isspeditable" select="//Params/Param[@name='isspeditable']"/> <xsl:variable name="isButtonsOnLeft" select="//Params/Param[@name='isButtonsOnLeft']"/> <xsl:variable name="showPrefCol" select="//Params/Param[@name='showPrefCol']"/> <xsl:variable name="STR_ACCOUNT_SYSTEM_TIP" select="//Params/Param[@name='STR_ACCOUNT_SYSTEM_TIP']"/> <xsl:variable name="STR_ACCOUNT_BOTH_TIP" select="//Params/Param[@name='STR_ACCOUNT_BOTH_TIP']"/> <xsl:variable name="STR_ACCOUNT_USER_TIP" select="//Params/Param[@name='STR_ACCOUNT_USER_TIP']"/> <xsl:variable name="STR_ACCOUNT_SYSTEM" select="//Params/Param[@name='STR_ACCOUNT_SYSTEM']"/> <xsl:variable name="STR_ACCOUNT_BOTH" select="//Params/Param[@name='STR_ACCOUNT_BOTH']"/> <xsl:variable name="STR_ACCOUNT_USER" select="//Params/Param[@name='STR_ACCOUNT_USER']"/> <xsl:variable name="STR_ACCESS_PREVENT" select="//Params/Param[@name='STR_ACCESS_PREVENT']"/> <xsl:variable name="STR_ACCESS_ASK" select="//Params/Param[@name='STR_ACCESS_ASK']"/> <xsl:variable name="STR_ACCESS_ALLOW" select="//Params/Param[@name='STR_ACCESS_ALLOW']"/> <xsl:variable name="STR_AUDIT_MONITOR" select="//Params/Param[@name='STR_AUDIT_MONITOR']"/> <xsl:variable name="STR_AUDIT_ALERT" select="//Params/Param[@name='STR_AUDIT_ALERT']"/> <xsl:variable name="STR_AUDIT_IGNORE" select="//Params/Param[@name='STR_AUDIT_IGNORE']"/> <xsl:variable name="STR_DEFPOL_MOVE2DEFPOL" select="//Params/Param[@name='STR_DEFPOL_MOVE2DEFPOL']"/> <xsl:variable name="STR_DEFPOL_MOVE2EXP" select="//Params/Param[@name='STR_DEFPOL_MOVE2EXP']"/> <xsl:variable name="STR_RULES_MOVE_DOWN" select="//Params/Param[@name='STR_RULES_MOVE_DOWN']"/> <xsl:variable name="STR_RULES_MOVE_UP" select="//Params/Param[@name='STR_RULES_MOVE_UP']"/> <xsl:variable name="STR_TOOLTIP_CLONE" select="//Params/Param[@name='STR_TOOLTIP_CLONE']"/> <xsl:variable name="STR_TOOLTIP_EDIT" select="//Params/Param[@name='STR_TOOLTIP_EDIT']"/> <xsl:variable name="STR_TOOLTIP_DELETE" select="//Params/Param[@name='STR_TOOLTIP_DELETE']"/> <xsl:variable name="STR_TOOLTIP_PREF" select="//Params/Param[@name='STR_TOOLTIP_PREF']"/> <xsl:variable name="STR_TOOLTIP_CHANGE_TO_PERMANENT" select="//Params/Param[@name='STR_TOOLTIP_CHANGE_TO_PERMANENT']"/> <xsl:variable name="STR_M2SDB_TOOLTIP" select="//Params/Param[@name='STR_M2SDB_TOOLTIP']"/> <xsl:variable name="STR_OPT_SEL_ALL_APP" select="//Params/Param[@name='STR_OPT_SEL_ALL_APP']"/> <xsl:variable name="STR_OPT_SEL_ALL_DLL" select="//Params/Param[@name='STR_OPT_SEL_ALL_DLL']"/> <xsl:template match="/"> <!-- sorting parameters --> <xsl:variable name="sortCol1"> <xsl:choose> <xsl:when test="$sortParam = 'app'">app_id</xsl:when> <xsl:when test="$sortParam = '-app'">app</xsl:when> <xsl:when test="$sortParam = 'time'">timeofday_id</xsl:when> <xsl:when test="$sortParam = '-time'">timeofday</xsl:when> <xsl:when test="$sortParam = '-user'">filter</xsl:when> <xsl:when test="$sortParam = 'user'">filter</xsl:when> <xsl:when test="$sortParam = '-object'">obj_id</xsl:when> <xsl:when test="$sortParam = 'object'">obj_id</xsl:when> <xsl:when test="starts-with($sortParam,'-')"><xsl:value-of select="substring-after($sortParam,'-')"/></xsl:when> <xsl:otherwise><xsl:value-of select="$sortParam"/></xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="sortCol2"> <xsl:choose> <xsl:when test="$sortParam = 'app'">app</xsl:when> <xsl:when test="$sortParam = '-app'">app_id</xsl:when> <xsl:when test="$sortParam = 'time'">timeofday</xsl:when> <xsl:when test="$sortParam = '-time'">timeofday_id</xsl:when> </xsl:choose> </xsl:variable> <xsl:variable name="sortCol3"> <xsl:if test="$sortParam='object' or $sortParam='-object'">Object</xsl:if> </xsl:variable> <xsl:variable name="sortDir"> <xsl:choose> <xsl:when test="starts-with($sortParam,'-')">ascending</xsl:when> <xsl:otherwise>descending</xsl:otherwise> </xsl:choose> </xsl:variable> <!-- <xsl:value-of select="$sortCol1"/> <xsl:text>|</xsl:text> <xsl:value-of select="$sortCol2"/> <xsl:text>|</xsl:text> <xsl:value-of select="$sortCol3"/>--> <xsl:choose> <xsl:when test="$easymode='exp'"> <xsl:if test="count(//RuleList/Rule[($ot = @ot) and ( ('high' = @priority) and not(@preferred=1 or @preferred='true') or ('low' = @priority) and (@preferred=1 or @preferred='true') ) ])=0"> <xsl:call-template name="noRow"/> </xsl:if> <xsl:for-each select="//RuleList/Rule[($ot = @ot) and ( ('high' = @priority) and not(@preferred=1 or @preferred='true') or ('low' = @priority) and (@preferred=1 or @preferred='true') ) ]"> <xsl:variable name="className"> <xsl:choose> <xsl:when test="position() mod 2 = 1"> <xsl:choose> <xsl:when test="@priority='high'">high_row_odd</xsl:when> <xsl:otherwise>odd</xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="@priority='high'">high_row_even</xsl:when> <xsl:otherwise>even</xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> <xsl:if test="@proc_id"> <xsl:text> tmpRow</xsl:text> </xsl:if> </xsl:variable> <xsl:apply-templates select="."> <xsl:with-param name="className" select="$className"/> </xsl:apply-templates> </xsl:for-each> </xsl:when> <xsl:when test="$easymode='defpol'"> <xsl:if test="count(//RuleList/Rule[($ot = @ot) and ( ('high' = @priority) and (@preferred=1 or @preferred='true') or ('low' = @priority) and not(@preferred=1 or @preferred='true') ) ])=0"> <xsl:call-template name="noRow"/> </xsl:if> <xsl:for-each select="//RuleList/Rule[($ot = @ot) and ( ('high' = @priority) and (@preferred=1 or @preferred='true') or ('low' = @priority) and not(@preferred=1 or @preferred='true') ) ]"> <xsl:variable name="className"> <xsl:choose> <xsl:when test="position() mod 2 = 1"> <xsl:choose> <xsl:when test="@priority='high'">high_row_odd</xsl:when> <xsl:otherwise>odd</xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="@priority='high'">high_row_even</xsl:when> <xsl:otherwise>even</xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> <xsl:if test="@proc_id"> <xsl:text> tmpRow</xsl:text> </xsl:if> </xsl:variable> <xsl:apply-templates select="."> <xsl:with-param name="className" select="$className"/> </xsl:apply-templates> </xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:if test="count(//RuleList/Rule[($ot = @ot) and (not($priority) or ($priority = @priority))])=0"> <xsl:call-template name="noRow"/> </xsl:if> <xsl:for-each select="//RuleList/Rule[($ot = @ot) and (not($priority) or ($priority = @priority))]"> <xsl:sort select="@*[name()=$sortCol1] | AccessDesc/@*[name()=$sortCol1]" order="{$sortDir}"/> <xsl:sort select="@*[name()=$sortCol2]" order="{$sortDir}"/> <xsl:sort select="*[name()=$sortCol3]" order="{$sortDir}"/> <xsl:variable name="className"> <xsl:choose> <xsl:when test="position() mod 2 = 1">odd</xsl:when> <xsl:otherwise>even</xsl:otherwise> </xsl:choose> <xsl:if test="@proc_id"> <xsl:text> tmpRow</xsl:text> </xsl:if> </xsl:variable> <xsl:apply-templates select="."> <xsl:with-param name="className" select="$className"/> </xsl:apply-templates> </xsl:for-each> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="Rule"> <xsl:param name="className"/> <xsl:variable name="simplerule"> <xsl:if test="$ot='File' and $proversion='true'"> <xsl:if test="starts-with( @desc, '@@:')"> <xsl:text>true</xsl:text> </xsl:if> </xsl:if> </xsl:variable> <xsl:choose> <xsl:when test="$viewmode=1 or ($viewmode=2 and ($readonly='true' or $simplerule='true'))"> <xsl:apply-templates select="." mode="detail_readonly"> <xsl:with-param name="className" select="$className"/> <xsl:with-param name="simplerule" select="$simplerule"/> </xsl:apply-templates> </xsl:when> <xsl:when test="$viewmode=2"> <xsl:apply-templates select="." mode="detail_editable"> <xsl:with-param name="className" select="$className"/> </xsl:apply-templates> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="$readonly='true' or $simplerule='true'"> <xsl:apply-templates select="." mode="simple_readonly"> <xsl:with-param name="className" select="$className"/> </xsl:apply-templates> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="." mode="simple_editable"> <xsl:with-param name="className" select="$className"/> </xsl:apply-templates> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="noRow"> <tr class="odd"> <td colspan="18" class="nomenu"> <xsl:value-of select="//Params/Param[@name='STR_NO_RULE']"/> </td> </tr> </xsl:template> <xsl:template name="getAccountTip"> <xsl:param name="strAccount"/> <xsl:choose> <xsl:when test="$strAccount='system'"> <xsl:value-of select="$STR_ACCOUNT_SYSTEM_TIP"/> </xsl:when> <xsl:when test="$strAccount='both'"> <xsl:value-of select="$STR_ACCOUNT_BOTH_TIP"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$STR_ACCOUNT_USER_TIP"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="getAccountText"> <xsl:param name="strAccount"/> <xsl:choose> <xsl:when test="$strAccount='system'"> <xsl:value-of select="$STR_ACCOUNT_SYSTEM"/> </xsl:when> <xsl:when test="$strAccount='both'"> <xsl:value-of select="$STR_ACCOUNT_BOTH"/> </xsl:when> <xsl:otherwise> <xsl:value-of disable-output-escaping="yes" select="$STR_ACCOUNT_USER"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="getAccessImg"> <xsl:param name="ar"/> <xsl:choose> <xsl:when test="$ar = 'Prevent'"> <img src="../img/prevent.gif" width="16" height="16"> <xsl:attribute name="title"> <xsl:value-of select="$STR_ACCESS_PREVENT"/> </xsl:attribute> </img> </xsl:when> <xsl:when test="$ar = 'AskUser'"> <img src="../img/askuser.gif" width="16" height="16"> <xsl:attribute name="title"> <xsl:value-of select="$STR_ACCESS_ASK"/> </xsl:attribute> </img> </xsl:when> <xsl:otherwise> <img src="../img/allow.gif" width="16" height="16"> <xsl:attribute name="title"> <xsl:value-of select="$STR_ACCESS_ALLOW"/> </xsl:attribute> </img> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="getAuditImg"> <xsl:param name="al"/> <xsl:choose> <xsl:when test="$al = 'Monitor'"> <img src="../img/monitor.gif" width="16" height="16"> <xsl:attribute name="title"> <xsl:value-of select="$STR_AUDIT_MONITOR"/> </xsl:attribute> </img> </xsl:when> <xsl:when test="$al = 'Alert'"> <img src="../img/alert.gif" width="16" height="16"> <xsl:attribute name="title"> <xsl:value-of select="$STR_AUDIT_ALERT"/> </xsl:attribute> </img> </xsl:when> <xsl:otherwise> <img src="../img/ignore.gif" width="16" height="16"> <xsl:attribute name="title"> <xsl:value-of select="$STR_AUDIT_IGNORE"/> </xsl:attribute> </img> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="getAuditTip"> <xsl:param name="al"/> <xsl:choose> <xsl:when test="$al = 'Monitor'"> <xsl:value-of select="$STR_AUDIT_MONITOR"/> </xsl:when> <xsl:when test="$al = 'Alert'"> <xsl:value-of select="$STR_AUDIT_ALERT"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$STR_AUDIT_IGNORE"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="getAccessTip"> <xsl:param name="ar"/> <xsl:choose> <xsl:when test="$ar = 'Prevent'"> <xsl:value-of select="$STR_ACCESS_PREVENT"/> </xsl:when> <xsl:when test="$ar = 'AskUser'"> <xsl:value-of select="$STR_ACCESS_ASK"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$STR_ACCESS_ALLOW"/> </xsl:otherwise> </xsl:choose> </xsl:template> <!--showAccess - draws ar/al icons for particular access type (at is distinguished by input parameter at & atid) --> <xsl:template match="Rule" mode="showAccess"> <!-- parameters at => e.g. KeyRead, atid => e.g. 25, ruleid => e.g. FS15 --> <xsl:param name="at" select="0"/> <xsl:param name="atid" select="0"/> <xsl:param name="ruleid" select="0"/> <xsl:param name="readonlyloc" select="0"/> <td style="white-space: nowrap;" class="nomenu"> <xsl:variable name="atcondition" select="AccessDesc[(@at = '*') or (@at = $at)]"/> <xsl:choose> <!-- if this access is present (or '*' is present), then find out the values --> <xsl:when test="count($atcondition)"> <xsl:for-each select="$atcondition"> <xsl:choose> <!-- for SpawnProcInOwnSbx display checkbox instead of icons --> <xsl:when test="@at = 'SpawnProcInOwnSbx'"> <input type="checkbox" onclick="OnParentSbxClick(this, '{$ruleid}');"> <xsl:choose> <xsl:when test="@ar = 'Prevent'"> <xsl:attribute name="checked"/> <xsl:attribute name="title"> <xsl:value-of select="//Params/Param[@name='STR_RULES_PARENT_SEC_CONTEXT']"/> </xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="title"> <xsl:value-of select="//Params/Param[@name='STR_RULES_NORMAL_SEC_CONTEXT']"/> </xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:if test="$readonlyloc='true' or $readonly='true'"> <xsl:attribute name="disabled"/> </xsl:if> </input> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="$readonlyloc='true' or $readonly='true'"> <span style="padding: 3px; width: 50%"> <xsl:call-template name="getAccessImg"> <xsl:with-param name="ar" select="@ar"/> </xsl:call-template> </span> </xsl:when> <xsl:otherwise> <a href="#" style="width: 50%;" onclick="FloatMenu_initAccess('{$ruleid}','{$priority}'=='high', {$atid}, {$clientrule}); toggleFloatMenu(this, 'arMenu', 'table_rules', 'rules'); return false;"> <xsl:call-template name="getAccessImg"> <xsl:with-param name="ar" select="@ar"/> </xsl:call-template> </a> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> <xsl:choose> <xsl:when test="$readonlyloc='true' or $readonly='true'"> <span style="padding: 3px; width: 50%"> <xsl:call-template name="getAuditImg"> <xsl:with-param name="al" select="@al"/> </xsl:call-template> </span> </xsl:when> <xsl:otherwise> <a href="#" style="width: 50%;" onclick="FloatMenu_initAudit( '{$ruleid}', {$atid}, {$clientrule}); toggleFloatMenu(this, 'alMenu','table_rules','rules'); return false;"> <xsl:call-template name="getAuditImg"> <xsl:with-param name="al" select="@al"/> </xsl:call-template> </a> </xsl:otherwise> </xsl:choose> </xsl:for-each> </xsl:when> <!-- if this access is not present => it means Allow/Ignore --> <xsl:otherwise> <xsl:choose> <!-- for SpawnProcInOwnSbx display checkbox instead of icons --> <xsl:when test="$at = 'SpawnProcInOwnSbx'"> <input type="checkbox" onclick="OnParentSbxClick(this, '{$ruleid}');"> <xsl:attribute name="title"> <xsl:value-of select="//Params/Param[@name='STR_RULES_NORMAL_SEC_CONTEXT']"/> </xsl:attribute> <xsl:if test="$readonlyloc='true' or $readonly='true'"> <xsl:attribute name="disabled"/> </xsl:if> </input> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="$readonlyloc='true' or $readonly='true'"> <span style="padding: 3px; width: 50%"> <xsl:call-template name="getAccessImg"> <xsl:with-param name="ar" select="'Allow'"/> </xsl:call-template> </span> </xsl:when> <xsl:otherwise> <a href="#" style="width: 50%;" onclick="FloatMenu_initAccess('{$ruleid}','{$priority}'=='high', {$atid}, {$clientrule}); toggleFloatMenu(this, 'arMenu', 'table_rules', 'rules'); return false;"> <xsl:call-template name="getAccessImg"> <xsl:with-param name="ar" select="'Allow'"/> </xsl:call-template> </a> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> <xsl:choose> <xsl:when test="$readonlyloc='true' or $readonly='true'"> <span style="padding: 3px; width: 50%"> <xsl:call-template name="getAuditImg"> <xsl:with-param name="al" select="'Ignore'"/> </xsl:call-template> </span> </xsl:when> <xsl:otherwise> <a href="#" style="width: 50%;" onclick="FloatMenu_initAudit( '{$ruleid}', {$atid}, {$clientrule}); toggleFloatMenu(this, 'alMenu','table_rules','rules'); return false;"> <xsl:call-template name="getAuditImg"> <xsl:with-param name="al" select="'Ignore'"/> </xsl:call-template> </a> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </td> </xsl:template> <xsl:template match="Rule" mode="showAccessTooltip"> <!-- parameters at => e.g. KeyRead, atid => e.g. 25, ruleid => e.g. FS15 --> <xsl:param name="at" select="0"/> <xsl:param name="atid" select="0"/> <xsl:variable name="atcondition" select="AccessDesc[(@at = '*') or (@at = $at)]"/> <xsl:choose> <!-- if this access is present (or '*' is present), then find out the values --> <xsl:when test="count($atcondition)"> <xsl:for-each select="$atcondition"> <xsl:choose> <!-- for SpawnProcInOwnSbx display checkbox instead of icons --> <xsl:when test="@at = 'SpawnProcInOwnSbx'"> <xsl:choose> <xsl:when test="@ar = 'Prevent'"> <xsl:value-of select="//Params/Param[@name='STR_RULES_PARENT_SEC_CONTEXT']"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="//Params/Param[@name='STR_RULES_NORMAL_SEC_CONTEXT']"/> </xsl:otherwise> </xsl:choose> <xsl:text>, </xsl:text> </xsl:when> <xsl:otherwise> <xsl:call-template name="getAccessTip"> <xsl:with-param name="ar" select="@ar"/> </xsl:call-template> <xsl:text>, </xsl:text> </xsl:otherwise> </xsl:choose> <xsl:call-template name="getAuditTip"> <xsl:with-param name="al" select="@al"/> </xsl:call-template> </xsl:for-each> </xsl:when> <!-- if this access is not present => it means Allow/Ignore --> <xsl:otherwise> <xsl:choose> <!-- for SpawnProcInOwnSbx display checkbox instead of icons --> <xsl:when test="$at = 'SpawnProcInOwnSbx'"> <xsl:value-of select="//Params/Param[@name='STR_RULES_NORMAL_SEC_CONTEXT']"/> <xsl:text>, </xsl:text> </xsl:when> <xsl:otherwise> <xsl:call-template name="getAccessTip"> <xsl:with-param name="ar" select="'Allow'"/> </xsl:call-template> <xsl:text>, </xsl:text> </xsl:otherwise> </xsl:choose> <xsl:call-template name="getAuditTip"> <xsl:with-param name="al" select="'Ignore'"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="Rule" mode="getBtns"> <xsl:param name="priority"/> <xsl:choose> <xsl:when test="@proc_id"> <a href="#" onclick="WS_CreatePermanentRule('{@id}',{$clientrule}); return false;"> <img src="../img/ico-save.gif"> <xsl:attribute name="alt"> <xsl:value-of select="$STR_TOOLTIP_CHANGE_TO_PERMANENT"/> </xsl:attribute> </img> </a> </xsl:when> <xsl:when test="$clientrule='true' and $isspeditable='true'"> <a href="#" onclick="WS_MoveToServerDB('{@id}'); return false;"> <img src="../img/ico-movetoserverdb.gif"> <xsl:attribute name="alt"> <xsl:value-of select="$STR_M2SDB_TOOLTIP"/> </xsl:attribute> </img> </a> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="$easymode='exp'"> <a href="#" onclick="WS_SwitchEasyRule( '{@id}' ); Reload('{@id}'); return false;"> <img src="../img/ico-down.gif" width="16" height="16"> <xsl:attribute name="title"> <xsl:value-of select="$STR_DEFPOL_MOVE2DEFPOL"/> </xsl:attribute> </img> </a> </xsl:when> <xsl:when test="$easymode='defpol'"> <a href="#" onclick="WS_SwitchEasyRule( '{@id}' ); Reload('{@id}'); return false;"> <img src="../img/ico-up.gif" width="16" height="16"> <xsl:attribute name="title"> <xsl:value-of select="$STR_DEFPOL_MOVE2EXP"/> </xsl:attribute> </img> </a> </xsl:when> <xsl:otherwise> <xsl:if test="$priority='high' or $priority='low'"> <a href="#" onclick="OnChangeRulePriority( '{@id}' ); return false;"> <xsl:choose> <xsl:when test="$priority='high'"> <img src="../img/ico-down.gif" width="16" height="16"> <xsl:attribute name="title"> <xsl:value-of select="$STR_RULES_MOVE_DOWN"/> </xsl:attribute> </img> </xsl:when> <xsl:otherwise> <img src="../img/ico-up.gif" width="16" height="16"> <xsl:attribute name="title"> <xsl:value-of select="$STR_RULES_MOVE_UP"/> </xsl:attribute> </img> </xsl:otherwise> </xsl:choose> </a> </xsl:if> </xsl:otherwise> </xsl:choose> <xsl:variable name="allaccesses"> <xsl:apply-templates select="//Params" mode="allaccesses"/> </xsl:variable> <a href="#" onclick="OnCloneRule('{@id}',{$clientrule}); return false;"> <img src="../img/ico_copy.gif" width="16" height="16"> <xsl:attribute name="title"> <xsl:value-of select="$STR_TOOLTIP_CLONE"/> </xsl:attribute> </img> </a> <a href="#" onclick="OnEditRule( '{@id}', '{$priority}' != 'low' && '{$priority}' != 'high','{$ot}', '{$otid}', '{$allaccesses}', '{$editobjhdr}', '{$editatcolumns}' ); return false;"> <img src="../img/ico-edit.gif" width="16" height="16"> <xsl:attribute name="title"> <xsl:value-of select="$STR_TOOLTIP_EDIT"/> </xsl:attribute> </img> </a> <a href="#" onclick="OnDeleteRule( '{@id}' ); return false;"> <img src="../img/ico-remove.gif" width="16" height="16"> <xsl:attribute name="title"> <xsl:value-of select="$STR_TOOLTIP_DELETE"/> </xsl:attribute> </img> </a> <input type="checkbox" name="_batch_rule_sign" value="{@id}" clientRule="{$clientrule}" style="display: none;"/> </xsl:template> <!-- Rule template - called from the \ template --> <xsl:template match="Rule" mode="simple_editable"> <xsl:param name="className"/> <!-- modify the row background color according to $ or even line --> <tr id="_rule_{@id}" ruleId="{@id}" class="{$className}"> <xsl:attribute name="title"> <xsl:apply-templates select="." mode="tooltip"> <xsl:with-param name="detail" select="'false'"/> </xsl:apply-templates> </xsl:attribute> <!-- first column is the 'rule enable' checkbox + the rule id --> <td> <input type="checkbox" align="absmiddle" onclick="OnDisableEnableRule( '{@id}', this.checked )"> <xsl:attribute name="title"> <xsl:value-of select="//Params/Param[@name='STR_RULES_ENABLE_TIP']"/> </xsl:attribute> <xsl:if test="(@disabled = '0') or not(@disabled)"> <xsl:attribute name="checked"/> </xsl:if> <xsl:if test="$disableChb='true'"> <xsl:attribute name="disabled"/> </xsl:if> </input> </td> <!-- move-to, edit and delete icons--> <xsl:if test="$isButtonsOnLeft='true'"> <td class="action" style="text-align: left;"> <xsl:apply-templates select="." mode="getBtns"> <xsl:with-param name="priority" select="@priority"/> </xsl:apply-templates> </td> </xsl:if> <td class="nomenu"> <xsl:choose> <xsl:when test="$ot = 'File' and starts-with( @desc, '@@:')"> <xsl:value-of select="//Params/Param[@name='STR_FRS_CANNOT_EDIT']"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@desc"/> </xsl:otherwise> </xsl:choose> </td> <!-- time of day --> <td style="white-space : nowrap;"> <a href="#" onclick="FloatMenu_initTime('{@id}', {$clientrule}, ''); toggleFloatMenu(this, 'timeMenu','table_rules','rules'); return false;"> <xsl:choose> <xsl:when test="@timeofday_id"> <xsl:value-of select="@timeofday_id"/> </xsl:when> <xsl:when test="not(@timeofday='*')"> <xsl:call-template name="formatDaytime"> <xsl:with-param name="daytime" select="@timeofday"/> </xsl:call-template> </xsl:when> </xsl:choose> </a> </td> <!-- optional User column --> <xsl:if test="($usercolumn = 'show') or ($usercolumn = 'showempty')"> <td> <xsl:if test="$usercolumn = 'show'"> <xsl:if test="not($clientrule='true')"> <a href="#" onclick="FloatMenu_initUsers('{@id}', ''); toggleFloatMenu(this, 'usersMenu', 'table_rules', 'rules'); return false;"> <xsl:call-template name="replaceWithBR"> <xsl:with-param name="string" select="@filter"/> <xsl:with-param name="what" select="'|'"/> </xsl:call-template> </a> </xsl:if> </xsl:if> </td> </xsl:if> <!-- move-to, edit and delete icons--> <xsl:if test="$isButtonsOnLeft!='true'"> <td class="action" style="text-align: right;"> <xsl:apply-templates select="." mode="getBtns"> <xsl:with-param name="priority" select="@priority"/> </xsl:apply-templates> </td> </xsl:if> </tr> </xsl:template> <xsl:template match="Rule" mode="simple_readonly"> <xsl:param name="className"/> <!-- modify the row background color according to $ or even line --> <tr id="_rule_{@id}" ruleId="{@id}" class="{$className}"> <xsl:attribute name="title"> <xsl:apply-templates select="." mode="tooltip"> <xsl:with-param name="detail" select="'false'"/> </xsl:apply-templates> </xsl:attribute> <!-- first column is the 'rule enable' checkbox + the rule id --> <td> <input disabled="disabled" type="checkbox" align="absmiddle" onclick="OnDisableEnableRule( '{@id}', this.checked )"> <xsl:attribute name="title"> <xsl:value-of select="//Params/Param[@name='STR_RULES_ENABLE_TIP']"/> </xsl:attribute> <xsl:if test="(@disabled = '0') or not(@disabled)"> <xsl:attribute name="checked"/> </xsl:if> </input> </td> <xsl:if test="$isButtonsOnLeft='true'"> <!-- move-to, edit and delete icons--> <td class="action" style="text-align: right;"> </td> </xsl:if> <td class="nomenu"> <xsl:choose> <xsl:when test="$ot = 'File' and starts-with( @desc, '@@:')"> <xsl:value-of select="//Params/Param[@name='STR_FRS_CANNOT_EDIT']"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@desc"/> </xsl:otherwise> </xsl:choose> </td> <!-- time of day --> <td style="white-space : nowrap;" class="nomenu"> <xsl:choose> <xsl:when test="@timeofday_id"> <xsl:value-of select="@timeofday_id"/> </xsl:when> <xsl:when test="not(@timeofday='*')"> <xsl:call-template name="formatDaytime"> <xsl:with-param name="daytime" select="@timeofday"/> </xsl:call-template> </xsl:when> </xsl:choose> </td> <!-- optional User column --> <xsl:if test="($usercolumn = 'show') or ($usercolumn = 'showempty')"> <td class="nomenu"> <xsl:if test="$usercolumn = 'show'"> <xsl:call-template name="replaceWithBR"> <xsl:with-param name="string" select="@filter"/> <xsl:with-param name="what" select="'|'"/> </xsl:call-template> </xsl:if> </td> </xsl:if> <xsl:if test="$isButtonsOnLeft!='true'"> <!-- move-to, edit and delete icons--> <td class="action" style="text-align: right;"> </td> </xsl:if> </tr> </xsl:template> <xsl:template match="Rule" mode="getObjValue"> <xsl:variable name="value"> <xsl:choose> <xsl:when test="Object"> <xsl:value-of select="Object"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@obj_id"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:choose> <xsl:when test="$value='*' and $ot='DllLoading'"> <xsl:choose> <xsl:when test="@dllobj=1 or @dllobj='true'"> <xsl:value-of select="$STR_OPT_SEL_ALL_DLL"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$STR_OPT_SEL_ALL_APP"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:value-of select="$value"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="Rule" mode="detail_editable"> <xsl:param name="className"/> <!-- modify the row background color according to $ or even line --> <tr id="_rule_{@id}" ruleId="{@id}" class="{$className}"> <xsl:attribute name="title"> <xsl:apply-templates select="." mode="tooltip"> <xsl:with-param name="detail" select="'true'"/> </xsl:apply-templates> </xsl:attribute> <!-- first column is the 'rule enable' checkbox + the rule id --> <td> <input type="checkbox" align="absmiddle" onclick="OnDisableEnableRule( '{@id}', this.checked )"> <xsl:attribute name="title"> <xsl:value-of select="//Params/Param[@name='STR_RULES_ENABLE_TIP']"/> </xsl:attribute> <xsl:if test="(@disabled = '0') or not(@disabled)"> <xsl:attribute name="checked"/> </xsl:if> <xsl:if test="$disableChb='true'"> <xsl:attribute name="disabled"/> </xsl:if> </input> </td> <xsl:if test="$showPrefCol='true'"> <td> <xsl:if test="not($clientrule='true') and (@preferred='1' or @preferred='true')"> <img src="../img/ico-pref.gif"> <xsl:attribute name="title"> <xsl:value-of select="$STR_TOOLTIP_PREF"/> </xsl:attribute> </img> </xsl:if> </td> </xsl:if> <!-- move-to, edit and delete icons--> <xsl:if test="$isButtonsOnLeft='true'"> <td class="action" style="text-align: left;"> <xsl:apply-templates select="." mode="getBtns"> <xsl:with-param name="priority" select="@priority"/> </xsl:apply-templates> </td> </xsl:if> <!-- second column is the object --> <xsl:if test="not($ot = 'SystemPrivilege')"> <td> <a href="#" onclick="FloatMenu_initObj('{$ot}', '{@id}', {$clientrule}, '', '',{$otid}); toggleFloatMenu(this, 'objMenu','table_rules','rules'); return false;"> <xsl:apply-templates select="." mode="getObjValue"/> </a> </td> </xsl:if> <!-- third column is the application or app group => if system app, then append $ --> <td> <a href="#" onclick="FloatMenu_initApp('{@id}','','',{$clientrule}); toggleFloatMenu(this, 'appMenu','table_rules','rules'); return false;"> <strong> <xsl:choose> <xsl:when test="@app_id"> <xsl:value-of select="@app_id"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@app"/> </xsl:otherwise> </xsl:choose> </strong> </a> </td> <xsl:if test="$accountcolumn='show'"> <td> <xsl:attribute name="title"> <xsl:call-template name="getAccountTip"> <xsl:with-param name="strAccount" select="@account"/> </xsl:call-template> </xsl:attribute> <a href="#" onclick="if (FloatMenu_initAccount('{@id}','','',{$clientrule})) toggleFloatMenu(this, 'accountMenu','table_rules','rules'); return false;"> <xsl:call-template name="getAccountText"> <xsl:with-param name="strAccount" select="@account"/> </xsl:call-template> </a> </td> </xsl:if> <!-- the 4+ columns are accesses => number of accesses is dependent on number of at_XXX parameters--> <xsl:variable name="curr_rule" select="."/> <xsl:for-each select="//Params/Param"> <xsl:if test="starts-with( @name, 'at_')"> <xsl:variable name="curr_atid" select="."/> <xsl:variable name="curr_at" select="substring-after( @name, 'at_' )"/> <xsl:apply-templates select="$curr_rule" mode="showAccess"> <xsl:with-param name="atid" select="$curr_atid"/> <xsl:with-param name="at" select="$curr_at"/> <xsl:with-param name="ruleid" select="$curr_rule/@id"/> </xsl:apply-templates> </xsl:if> </xsl:for-each> <!-- time of day --> <td style="white-space : nowrap;"> <a href="#" onclick="FloatMenu_initTime('{@id}', {$clientrule}, ''); toggleFloatMenu(this, 'timeMenu','table_rules','rules'); return false;"> <xsl:choose> <xsl:when test="@timeofday_id"> <xsl:value-of select="@timeofday_id"/> </xsl:when> <xsl:when test="not(@timeofday='*')"> <xsl:call-template name="formatDaytime"> <xsl:with-param name="daytime" select="@timeofday"/> </xsl:call-template> </xsl:when> </xsl:choose> </a> </td> <!-- optional User column --> <xsl:if test="($usercolumn = 'show') or ($usercolumn = 'showempty')"> <td> <xsl:if test="$usercolumn = 'show'"> <xsl:if test="not($clientrule='true')"> <a href="#" onclick="FloatMenu_initUsers('{@id}', ''); toggleFloatMenu(this, 'usersMenu', 'table_rules', 'rules'); return false;"> <xsl:call-template name="replaceWithBR"> <xsl:with-param name="string" select="@filter"/> <xsl:with-param name="what" select="'|'"/> </xsl:call-template> </a> </xsl:if> </xsl:if> </td> </xsl:if> <!-- move-to, edit and delete icons--> <xsl:if test="$isButtonsOnLeft!='true'"> <td class="action" style="text-align: right;"> <xsl:apply-templates select="." mode="getBtns"> <xsl:with-param name="priority" select="@priority"/> </xsl:apply-templates> </td> </xsl:if> </tr> </xsl:template> <xsl:template match="Rule" mode="detail_readonly"> <xsl:param name="className"/> <xsl:param name="simplerule"/> <!-- modify the row background color according to $ or even line --> <tr id="_rule_{@id}" ruleId="{@id}" class="{$className}"> <xsl:attribute name="title"> <xsl:apply-templates select="." mode="tooltip"> <xsl:with-param name="detail" select="'true'"/> </xsl:apply-templates> </xsl:attribute> <!-- first column is the 'rule enable' checkbox + the rule id --> <td> <input type="checkbox" align="absmiddle" onclick="OnDisableEnableRule( '{@id}', this.checked )"> <xsl:attribute name="title"> <xsl:value-of select="//Params/Param[@name='STR_RULES_ENABLE_TIP']"/> </xsl:attribute> <xsl:if test="(@disabled = '0') or not(@disabled)"> <xsl:attribute name="checked"/> </xsl:if> <xsl:if test="$readonly='true' or $disableChb='true' or $simplerule='true'"> <xsl:attribute name="disabled"/> </xsl:if> </input> </td> <xsl:if test="$showPrefCol='true'"> <td> <xsl:if test="not($clientrule='true') and (@preferred='1' or @preferred='true')"> <img src="../img/ico-pref.gif"> <xsl:attribute name="title"> <xsl:value-of select="$STR_TOOLTIP_PREF"/> </xsl:attribute> </img> </xsl:if> </td> </xsl:if> <!-- move-to, edit and delete icons--> <xsl:if test="$isButtonsOnLeft='true'"> <td class="action" style="text-align: left;"> <xsl:if test="not($readonly='true') and not($simplerule='true')"> <xsl:apply-templates select="." mode="getBtns"> <xsl:with-param name="priority" select="@priority"/> </xsl:apply-templates> </xsl:if> </td> </xsl:if> <!-- second column is the object --> <xsl:if test="not($ot = 'SystemPrivilege')"> <td class="nomenu"> <xsl:apply-templates select="." mode="getObjValue"/> </td> </xsl:if> <!-- third column is the application or app group => if system app, then append $ --> <td class="nomenu"> <strong> <xsl:choose> <xsl:when test="@app_id"> <xsl:value-of select="@app_id"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@app"/> </xsl:otherwise> </xsl:choose> </strong> </td> <xsl:if test="$accountcolumn='show'"> <td class="nomenu"> <xsl:attribute name="title"> <xsl:call-template name="getAccountTip"> <xsl:with-param name="strAccount" select="@account"/> </xsl:call-template> </xsl:attribute> <xsl:call-template name="getAccountText"> <xsl:with-param name="strAccount" select="@account"/> </xsl:call-template> </td> </xsl:if> <!-- the 4+ columns are accesses => number of accesses is dependent on number of at_XXX parameters--> <xsl:variable name="curr_rule" select="."/> <xsl:for-each select="//Params/Param"> <xsl:if test="starts-with( @name, 'at_')"> <xsl:variable name="curr_atid" select="."/> <xsl:variable name="curr_at" select="substring-after( @name, 'at_' )"/> <xsl:apply-templates select="$curr_rule" mode="showAccess"> <xsl:with-param name="atid" select="$curr_atid"/> <xsl:with-param name="at" select="$curr_at"/> <xsl:with-param name="ruleid" select="$curr_rule/@id"/> <xsl:with-param name="readonlyloc" select="'true'"/> </xsl:apply-templates> </xsl:if> </xsl:for-each> <!-- time of day --> <td style="white-space : nowrap;" class="nomenu"> <xsl:choose> <xsl:when test="@timeofday_id"> <xsl:value-of select="@timeofday_id"/> </xsl:when> <xsl:when test="not(@timeofday='*')"> <xsl:call-template name="formatDaytime"> <xsl:with-param name="daytime" select="@timeofday"/> </xsl:call-template> </xsl:when> </xsl:choose> </td> <!-- optional User column --> <xsl:if test="($usercolumn = 'show') or ($usercolumn = 'showempty')"> <td class="nomenu"> <xsl:if test="$usercolumn = 'show'"> <xsl:if test="not($clientrule='true')"> <xsl:call-template name="replaceWithBR"> <xsl:with-param name="string" select="@filter"/> <xsl:with-param name="what" select="'|'"/> </xsl:call-template> </xsl:if> </xsl:if> </td> </xsl:if> <!-- move-to, edit and delete icons--> <xsl:if test="$isButtonsOnLeft!='true'"> <td class="action" style="text-align: right;"> <xsl:if test="not($readonly='true') and not($simplerule='true')"> <xsl:apply-templates select="." mode="getBtns"> <xsl:with-param name="priority" select="@priority"/> </xsl:apply-templates> </xsl:if> </td> </xsl:if> </tr> </xsl:template> <xsl:template name="getColumnHeader"> <xsl:param name="index"/> </xsl:template> <xsl:template match="Rule" mode="tooltip"> <xsl:param name="detail"/> <xsl:choose> <xsl:when test="not($detail='true')"> <xsl:if test="not($ot = 'SystemPrivilege')"> <xsl:value-of select="$editobjhdr"/><xsl:text>: </xsl:text> <xsl:choose> <xsl:when test="Object"> <xsl:value-of select="Object"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@obj_id"/> </xsl:otherwise> </xsl:choose> <xsl:text disable-output-escaping="no">
</xsl:text> </xsl:if> <xsl:choose> <xsl:when test="$ot='DllLoading'"> <xsl:value-of select="//Params/Param[@name='STR_CH_LOAD_BY']"/> </xsl:when> <xsl:when test="$ot='Spawning'"> <xsl:value-of select="//Params/Param[@name='STR_CH_START_BY']"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="//Params/Param[@name='STR_CH_APP']"/> </xsl:otherwise> </xsl:choose> <xsl:text>: </xsl:text> <xsl:choose> <xsl:when test="@app_id"> <xsl:value-of select="@app_id"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@app"/> </xsl:otherwise> </xsl:choose> <xsl:text disable-output-escaping="no">
</xsl:text> <xsl:variable name="curr_rule" select="."/> <xsl:for-each select="//Params/Param"> <xsl:if test="starts-with( @name, 'at_')"> <xsl:variable name="curr_atid" select="."/> <xsl:variable name="curr_at" select="substring-after( @name, 'at_' )"/> <xsl:variable name="curr_atHdr" select="concat($curr_at,'ColHdr')"/> <xsl:value-of select="//Params/Param[@name=$curr_atHdr]"/><xsl:text>: </xsl:text> <xsl:apply-templates select="$curr_rule" mode="showAccessTooltip"> <xsl:with-param name="atid" select="$curr_atid"/> <xsl:with-param name="at" select="$curr_at"/> </xsl:apply-templates> <xsl:text disable-output-escaping="no">
</xsl:text> </xsl:if> </xsl:for-each> <xsl:value-of select="//Params/Param[@name='STR_CH_TIME']"/><xsl:text>: </xsl:text> <xsl:choose> <xsl:when test="@timeofday_id"> <xsl:value-of select="@timeofday_id"/> </xsl:when> <xsl:when test="not(@timeofday='*')"> <xsl:call-template name="formatDaytime"> <xsl:with-param name="daytime" select="@timeofday"/> </xsl:call-template> </xsl:when> </xsl:choose> <xsl:text disable-output-escaping="no">
</xsl:text> <xsl:if test="($usercolumn = 'show') or ($usercolumn = 'showempty')"> <xsl:if test="$usercolumn='show' and not($clientrule='true')"> <xsl:value-of select="//Params/Param[@name='STR_CH_USER']"/><xsl:text>: </xsl:text> <xsl:call-template name="replace"> <xsl:with-param name="string" select="@filter"/> <xsl:with-param name="what" select="'|'"/> <xsl:with-param name="with" select="', '"/> </xsl:call-template> </xsl:if> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="$ot = 'File' and starts-with( @desc, '@@:')"> <xsl:value-of select="//Params/Param[@name='STR_FRS_CANNOT_EDIT']"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@desc"/> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- template Params mode=allaccesses => used to construct variable $allaccesses to be used for OnEditRule call --> <xsl:template match="Params" mode="allaccesses"> <xsl:for-each select="Param[starts-with( @name, 'at_')]"> <xsl:if test="not(position() = 1)"> <xsl:text>&</xsl:text> </xsl:if> <xsl:value-of select="@name"/> <xsl:text>=</xsl:text> <xsl:value-of select="self::*"/> </xsl:for-each> </xsl:template> </xsl:stylesheet>